<%@ page language="java" contentType="text/html; charset=UTF-8" pageEncoding="UTF-8"%>
<%String path = request.getContextPath() ;%>
<%@ taglib uri="/WEB-INF/tld/c.tld" prefix="c" %>
<%@ taglib uri="/WEB-INF/tld/ui.tld" prefix="ui" %>
<!DOCTYPE html>
<html lang="zh-CN">
<head>
    <meta http-equiv="Content-Type" content="text/html; charset=UTF-8">
    <title>事业单位资产负债</title>
    <jsp:include page="../../import.jsp" flush="true" />
    <style type="text/css">
        .field button {
            height: 18px;
            font-size: 10px;
        }
    </style>
</head>
<body class="iframeBody">
<div class="Wrapper">
    <div class="pageIn2layout">
        <div class="pageIn2L_side">
            <div class="sqPanel">
                <div class="sqPanel_head"></div>
                <div class="sqPanel_body">
                    <ul class="links">
                        <li id="inNav_01" data-src="<%=path%>/customer/cstbscinfo/toFilFinanceDebtPage.do?cstId=${cstId}">事业单位资产负债表</li>
                        <li id="inNav_02" data-src="<%=path%>/customer/filExpenseZx/toFilExpenseZxPage.do?cstId=${cstId}">事业单位收入支出</li>
                    </ul>
                </div>
            </div>
        </div>
        <div class="pageIn2L_mid">
            <input name="cstId" id="cstId" type="text" style="display: none;" value="${cstId}"/>
            <form id="import_form">
                <div class="fieldset1 tabel_col tabel_col_1 clearFix">
                    <div class="fieldBox col_100">
                        <div class="label">批量导入</div>
                        <div class="field">
                            <jsp:include page="../../system/sysUlFilesRec/sysSysUlFilesRecUpload.jsp" flush="true" >
                                <jsp:param name="fileNum" value="1"/>
                                <jsp:param name="filePath" value="customer/filcreditfinance"/>
                            </jsp:include>
                            <span id="addBatchBtn" class="sq-button sq-button-hasicon" onclick="addBatch();"><i class="sqBtnIco_33"></i>批量导入</span>
                            <span id="downTempBtn" class="sq-button sq-button-hasicon" onclick="downTemp();"><i class="sqBtnIco_8"></i>下载模板</span>
                            <span style="float:right;color:red;">注：只会读取一条数据,多填写的数据无效！</span>
                        </div>
                    </div>
                </div>
            </form>
            <form id="formSet">
                <div class="fieldset2 clearFix">
                    <div class="caption">
                        <span class="title">报表信息</span>
                    </div>
                    <div class="table table_full">
                        <div class="table_cell labels" style="width: 300px;">
                            <div class="label_item">报表年份</div>
                            <div class="label_item">报表类型</div>
                            <div class="label_item">报表类型细分</div>
                            <div class="label_item">审计事务所名称</div>
                            <div class="label_item">审计人员名称</div>
                            <div class="label_item">审计时间</div>

                            <div class="label_item">现金</div>
                            <div class="label_item">银行存款</div>
                            <div class="label_item">应收票据</div>
                            <div class="label_item">应收帐款</div>
                            <div class="label_item">预付账款</div>
                            <div class="label_item">其他应收款</div>
                            <div class="label_item">材料</div>
                            <div class="label_item">产成品</div>
                            <div class="label_item">对外投资</div>
                            <div class="label_item">固定资产</div>
                            <div class="label_item">无形资产</div>
                            <div class="label_item">资产合计</div>
                            <div class="label_item">拔出经费</div>
                            <div class="label_item">拔出专款</div>
                            <div class="label_item">专款支出</div>
                            <div class="label_item">事业支出</div>
                            <div class="label_item">经营支出</div>
                            <div class="label_item">成本费用</div>
                            <div class="label_item">销售税金</div>
                            <div class="label_item">上缴上级支出</div>
                            <div class="label_item">对附属单位补助</div>
                            <div class="label_item">结转自筹基建</div>
                            <div class="label_item">支出合计</div>
                            <div class="label_item">资产部类总计</div>
                            <div class="label_item">借记款项</div>
                            <div class="label_item">应付票据</div>
                            <div class="label_item">应付账款</div>
                            <div class="label_item">预收帐款</div>
                            <div class="label_item">其他应付款</div>
                            <div class="label_item">应缴预算款</div>
                            <div class="label_item">应缴财政专户款</div>
                            <div class="label_item">应交税金</div>
                            <div class="label_item">负债合计</div>
                            <div class="label_item">事业基金</div>
                            <div class="label_item">一般基金</div>
                            <div class="label_item">投资基金</div>
                            <div class="label_item">固定基金</div>
                            <div class="label_item">专用基金</div>
                            <div class="label_item">事业结余</div>
                            <div class="label_item">经营结余</div>
                            <div class="label_item">净资产合计</div>
                            <div class="label_item">财政补助收入</div>
                            <div class="label_item">上级补助收入</div>
                            <div class="label_item">拔入专款</div>
                            <div class="label_item">事业收入</div>
                            <div class="label_item">经营收入</div>
                            <div class="label_item">附属单位缴款</div>
                            <div class="label_item">其他收入</div>
                            <div class="label_item">收入合计</div>
                            <div class="label_item">负债部类总计</div>
                        </div>
                        <div class="table_cell fields formdiva">
                            <div class="field_item"><input name="reportyear" type="text" class="ui-textbox" value="" validate="{required:true}" /><span class="requiredSymbol">*</span></div>
                            <div class="field_item">
                                <select name="reporttype" data-value=" " validate="{required:true, select: true}">
                                    <option value="  " selected="selected">--请选择--</option>
                                    <c:forEach items="${reportTypeList}" var="opt">
                                        <option value="${opt.key}">${opt.value}</option>
                                    </c:forEach>
                                </select>
                                <span class="requiredSymbol">*</span>
                            </div>
                            <div class="field_item">
                                <select name="reportsubtype" data-value=" " validate="{required:true, select: true}">
                                    <option value="  " selected="selected">--请选择--</option>
                                    <c:forEach items="${reportsubTypeList}" var="opt">
                                        <option value="${opt.key}">${opt.value}</option>
                                    </c:forEach>
                                </select>
                                <span class="requiredSymbol">*</span>
                            </div>
                            <div class="field_item"><input name="auditfirm" type="text" class="ui-textbox" value="" /></div>
                            <div class="field_item"><input name="auditor" type="text" class="ui-textbox" value="" /></div>
                            <div class="field_item"><input name="auditdate" type="text" class="ui-textbox" value="" /></div>

                            <div class="field_item"><input name="j9271" type="text" class="ui-textbox" value="" /></div>
                            <div class="field_item"><input name="j9272" type="text" class="ui-textbox" value="" /></div>
                            <div class="field_item"><input name="j9273" type="text" class="ui-textbox" value="" /></div>
                            <div class="field_item"><input name="j9274" type="text" class="ui-textbox" value="" /></div>
                            <div class="field_item"><input name="j9275" type="text" class="ui-textbox" value="" /></div>
                            <div class="field_item"><input name="j9276" type="text" class="ui-textbox" value="" /></div>
                            <div class="field_item"><input name="j9277" type="text" class="ui-textbox" value="" /></div>
                            <div class="field_item"><input name="j9278" type="text" class="ui-textbox" value="" /></div>
                            <div class="field_item"><input name="j9279" type="text" class="ui-textbox" value="" /></div>
                            <div class="field_item"><input name="j9280" type="text" class="ui-textbox" value="" /></div>
                            <div class="field_item"><input name="j9281" type="text" class="ui-textbox" value="" /></div>
                            <div class="field_item"><input name="j9282" type="text" class="ui-textbox" value="" validate="{required:true}" /><span class="requiredSymbol">*</span></div>
                            <div class="field_item"><input name="j9283" type="text" class="ui-textbox" value="" /></div>
                            <div class="field_item"><input name="j9284" type="text" class="ui-textbox" value="" /></div>
                            <div class="field_item"><input name="j9285" type="text" class="ui-textbox" value="" /></div>
                            <div class="field_item"><input name="j9286" type="text" class="ui-textbox" value="" /></div>
                            <div class="field_item"><input name="j9287" type="text" class="ui-textbox" value="" /></div>
                            <div class="field_item"><input name="j9288" type="text" class="ui-textbox" value="" /></div>
                            <div class="field_item"><input name="j9289" type="text" class="ui-textbox" value="" /></div>
                            <div class="field_item"><input name="j9290" type="text" class="ui-textbox" value="" /></div>
                            <div class="field_item"><input name="j9291" type="text" class="ui-textbox" value="" /></div>
                            <div class="field_item"><input name="j9292" type="text" class="ui-textbox" value="" /></div>
                            <div class="field_item"><input name="j9293" type="text" class="ui-textbox" value="" validate="{required:true}" /><span class="requiredSymbol">*</span></div>
                            <div class="field_item"><input name="j9294" type="text" class="ui-textbox" value="" validate="{required:true}" /><span class="requiredSymbol">*</span></div>
                            <div class="field_item"><input name="j9295" type="text" class="ui-textbox" value="" /></div>
                            <div class="field_item"><input name="j9296" type="text" class="ui-textbox" value="" /></div>
                            <div class="field_item"><input name="j9297" type="text" class="ui-textbox" value="" /></div>
                            <div class="field_item"><input name="j9298" type="text" class="ui-textbox" value="" /></div>
                            <div class="field_item"><input name="j9299" type="text" class="ui-textbox" value="" /></div>
                            <div class="field_item"><input name="j9300" type="text" class="ui-textbox" value="" /></div>
                            <div class="field_item"><input name="j9301" type="text" class="ui-textbox" value="" /></div>
                            <div class="field_item"><input name="j9302" type="text" class="ui-textbox" value="" /></div>
                            <div class="field_item"><input name="j9303" type="text" class="ui-textbox" value="" validate="{required:true}" /><span class="requiredSymbol">*</span></div>
                            <div class="field_item"><input name="j9304" type="text" class="ui-textbox" value="" /></div>
                            <div class="field_item"><input name="j9305" type="text" class="ui-textbox" value="" /></div>
                            <div class="field_item"><input name="j9306" type="text" class="ui-textbox" value="" /></div>
                            <div class="field_item"><input name="j9307" type="text" class="ui-textbox" value="" /></div>
                            <div class="field_item"><input name="j9308" type="text" class="ui-textbox" value="" /></div>
                            <div class="field_item"><input name="j9309" type="text" class="ui-textbox" value="" /></div>
                            <div class="field_item"><input name="j9310" type="text" class="ui-textbox" value="" /></div>
                            <div class="field_item"><input name="j9311" type="text" class="ui-textbox" value="" validate="{required:true}" /><span class="requiredSymbol">*</span></div>
                            <div class="field_item"><input name="j9312" type="text" class="ui-textbox" value="" /></div>
                            <div class="field_item"><input name="j9313" type="text" class="ui-textbox" value="" /></div>
                            <div class="field_item"><input name="j9314" type="text" class="ui-textbox" value="" /></div>
                            <div class="field_item"><input name="j9315" type="text" class="ui-textbox" value="" /></div>
                            <div class="field_item"><input name="j9316" type="text" class="ui-textbox" value="" /></div>
                            <div class="field_item"><input name="j9317" type="text" class="ui-textbox" value="" /></div>
                            <div class="field_item"><input name="j9318" type="text" class="ui-textbox" value="" /></div>
                            <div class="field_item"><input name="j9319" type="text" class="ui-textbox" value="" validate="{required:true}" /><span class="requiredSymbol">*</span></div>
                            <div class="field_item"><input name="j9320" type="text" class="ui-textbox" value="" validate="{required:true}" /><span class="requiredSymbol">*</span></div>
                        </div>
                        <div class="table_cell fields formdivb">
                            <div class="field_item"><input name="reportyear" type="text" class="ui-textbox" value="" validate="{required:true}" /><span class="requiredSymbol">*</span></div>
                            <div class="field_item">
                                <select name="reporttype" data-value=" " validate="{required:true, select: true}">
                                    <option value="  " selected="selected">--请选择--</option>
                                    <c:forEach items="${reportTypeList}" var="opt">
                                        <option value="${opt.key}">${opt.value}</option>
                                    </c:forEach>
                                </select>
                                <span class="requiredSymbol">*</span>
                            </div>
                            <div class="field_item">
                                <select name="reportsubtype" data-value=" " validate="{required:true, select: true}">
                                    <option value="  " selected="selected">--请选择--</option>
                                    <c:forEach items="${reportsubTypeList}" var="opt">
                                        <option value="${opt.key}">${opt.value}</option>
                                    </c:forEach>
                                </select>
                                <span class="requiredSymbol">*</span>
                            </div>
                            <div class="field_item"><input name="auditfirm" type="text" class="ui-textbox" value="" /></div>
                            <div class="field_item"><input name="auditor" type="text" class="ui-textbox" value="" /></div>
                            <div class="field_item"><input name="auditdate" type="text" class="ui-textbox" value="" /></div>

                            <div class="field_item"><input name="j9271" type="text" class="ui-textbox" value="" /></div>
                            <div class="field_item"><input name="j9272" type="text" class="ui-textbox" value="" /></div>
                            <div class="field_item"><input name="j9273" type="text" class="ui-textbox" value="" /></div>
                            <div class="field_item"><input name="j9274" type="text" class="ui-textbox" value="" /></div>
                            <div class="field_item"><input name="j9275" type="text" class="ui-textbox" value="" /></div>
                            <div class="field_item"><input name="j9276" type="text" class="ui-textbox" value="" /></div>
                            <div class="field_item"><input name="j9277" type="text" class="ui-textbox" value="" /></div>
                            <div class="field_item"><input name="j9278" type="text" class="ui-textbox" value="" /></div>
                            <div class="field_item"><input name="j9279" type="text" class="ui-textbox" value="" /></div>
                            <div class="field_item"><input name="j9280" type="text" class="ui-textbox" value="" /></div>
                            <div class="field_item"><input name="j9281" type="text" class="ui-textbox" value="" /></div>
                            <div class="field_item"><input name="j9282" type="text" class="ui-textbox" value="" validate="{required:true}" /><span class="requiredSymbol">*</span></div>
                            <div class="field_item"><input name="j9283" type="text" class="ui-textbox" value="" /></div>
                            <div class="field_item"><input name="j9284" type="text" class="ui-textbox" value="" /></div>
                            <div class="field_item"><input name="j9285" type="text" class="ui-textbox" value="" /></div>
                            <div class="field_item"><input name="j9286" type="text" class="ui-textbox" value="" /></div>
                            <div class="field_item"><input name="j9287" type="text" class="ui-textbox" value="" /></div>
                            <div class="field_item"><input name="j9288" type="text" class="ui-textbox" value="" /></div>
                            <div class="field_item"><input name="j9289" type="text" class="ui-textbox" value="" /></div>
                            <div class="field_item"><input name="j9290" type="text" class="ui-textbox" value="" /></div>
                            <div class="field_item"><input name="j9291" type="text" class="ui-textbox" value="" /></div>
                            <div class="field_item"><input name="j9292" type="text" class="ui-textbox" value="" /></div>
                            <div class="field_item"><input name="j9293" type="text" class="ui-textbox" value="" validate="{required:true}" /><span class="requiredSymbol">*</span></div>
                            <div class="field_item"><input name="j9294" type="text" class="ui-textbox" value="" validate="{required:true}" /><span class="requiredSymbol">*</span></div>
                            <div class="field_item"><input name="j9295" type="text" class="ui-textbox" value="" /></div>
                            <div class="field_item"><input name="j9296" type="text" class="ui-textbox" value="" /></div>
                            <div class="field_item"><input name="j9297" type="text" class="ui-textbox" value="" /></div>
                            <div class="field_item"><input name="j9298" type="text" class="ui-textbox" value="" /></div>
                            <div class="field_item"><input name="j9299" type="text" class="ui-textbox" value="" /></div>
                            <div class="field_item"><input name="j9300" type="text" class="ui-textbox" value="" /></div>
                            <div class="field_item"><input name="j9301" type="text" class="ui-textbox" value="" /></div>
                            <div class="field_item"><input name="j9302" type="text" class="ui-textbox" value="" /></div>
                            <div class="field_item"><input name="j9303" type="text" class="ui-textbox" value="" validate="{required:true}" /><span class="requiredSymbol">*</span></div>
                            <div class="field_item"><input name="j9304" type="text" class="ui-textbox" value="" /></div>
                            <div class="field_item"><input name="j9305" type="text" class="ui-textbox" value="" /></div>
                            <div class="field_item"><input name="j9306" type="text" class="ui-textbox" value="" /></div>
                            <div class="field_item"><input name="j9307" type="text" class="ui-textbox" value="" /></div>
                            <div class="field_item"><input name="j9308" type="text" class="ui-textbox" value="" /></div>
                            <div class="field_item"><input name="j9309" type="text" class="ui-textbox" value="" /></div>
                            <div class="field_item"><input name="j9310" type="text" class="ui-textbox" value="" /></div>
                            <div class="field_item"><input name="j9311" type="text" class="ui-textbox" value="" validate="{required:true}" /><span class="requiredSymbol">*</span></div>
                            <div class="field_item"><input name="j9312" type="text" class="ui-textbox" value="" /></div>
                            <div class="field_item"><input name="j9313" type="text" class="ui-textbox" value="" /></div>
                            <div class="field_item"><input name="j9314" type="text" class="ui-textbox" value="" /></div>
                            <div class="field_item"><input name="j9315" type="text" class="ui-textbox" value="" /></div>
                            <div class="field_item"><input name="j9316" type="text" class="ui-textbox" value="" /></div>
                            <div class="field_item"><input name="j9317" type="text" class="ui-textbox" value="" /></div>
                            <div class="field_item"><input name="j9318" type="text" class="ui-textbox" value="" /></div>
                            <div class="field_item"><input name="j9319" type="text" class="ui-textbox" value="" validate="{required:true}" /><span class="requiredSymbol">*</span></div>
                            <div class="field_item"><input name="j9320" type="text" class="ui-textbox" value="" validate="{required:true}" /><span class="requiredSymbol">*</span></div>
                        </div>
                    </div>
                </div>
                <div class="btnsBox" id="saveBtn">
                    <span id="saveBtn1" class="sq-button sq-button-round" onclick="saveFormDate()">保存</span>
                </div>
            </form>
        </div>
    </div>
</div>

<script type="text/javascript">
    $(function () {
        $('.pageIn2L_side .links').pageInSideLink({currentNav: 'inNav_01'});
        $("#import_form").ligerForm();
        $("#formSet").ligerForm({
            validate: true
        });
        $(".formdivb").each(function(){
        	$(this).hide();
        });
        initFormData();
        SetIframe_height();
    });
    //下载模板
    function downTemp(){
        window.location.href="<%=path%>/resource/template/filcreditfinance/FinanceDebtInsSheet.xls";
    }
    //是否启用输入选择框(1是，0否)
    function isSwitch(type){

        if(type==0){
            $('#formSet select').each(function(){
                var ligeruiid = $(this).attr('ligeruiid');
                liger.get(ligeruiid).setDisabled();
            });
            $('#formSet .ui-textbox').each(function(){
                var ligeruiid = $(this).attr('ligeruiid');
                liger.get(ligeruiid).setDisabled(true);
            });
            $('#saveBtn').css("display","none");
        }else{
            $('#formSet select').each(function(){
                var ligeruiid = $(this).attr('ligeruiid');
                liger.get(ligeruiid).setEnabled();
            });
            $('#formSet .ui-textbox').each(function(){
                var ligeruiid = $(this).attr('ligeruiid');
                liger.get(ligeruiid).setEnabled(true);
            });
            $('#saveBtn').css("display","block");
            SetIframe_height();
        }
    }
    //初始化数据
    function initFormData(){
        var _cstid=$("#cstId").val();
        if(!_cstid){
            return;
        }
        var _url = '<%=path%>/customer/filFinanceDebtZx/selectDebtZxList.do';
        AjaxUtils.ajaxGet(_url, {cstId:_cstid}, function(msg){
            if(msg.success == 1){
                setFormData(msg.data);//设置数据

                isSwitch(0);
            }else{
                UIUtils.alertError(msg.info);
            }
        }, false);
    }
    //赋值
    function setFormData(data){
        if(data != undefined && data !=null && data.length!=0){
            if(data[0] != undefined && data[0]!=null){
                var forma = data[0];
                var objKeys = Object.keys(forma);
                for(var i = 0; i<objKeys.length; i++){
                    if(objKeys[i] != 'id'){
                        var ligeruiid = $(".formdiva [name="+objKeys[i]+"]").attr('ligeruiid');
                        if(ligeruiid) {
                            liger.get(ligeruiid).setValue(forma[objKeys[i]]);
                        }
                    }
                }
            }
            /* if(data[1] != undefined && data[1]!=null){
                var formb = data[1];
                var objKeys = Object.keys(formb);
                for(var i = 0; i<objKeys.length; i++){
                    if(objKeys[i] != 'id') {
                        var ligeruiid = $(".formdivb [name="+objKeys[i]+"]").attr('ligeruiid');
                        if(ligeruiid) {
                            liger.get(ligeruiid).setValue(formb[objKeys[i]]);
                        }
                    }
                }
            } */
        }
    }
    //取值
    function getFormValue(){
        var perList = [];
        var formdatea = {};
        /* var formdateb = {}; */
        var _cstid=$("#cstId").val();
        formdatea['cstId']=_cstid;
        /* formdateb['cstId']=_cstid; */
        $('.formdiva').each(function(i,a){
            $('.ui-textbox, select',a).each(function(i,b){
                var _name=$(b).attr('name');
                var _value=$(b).val();
                formdatea[_name]=_value;
            });
        });
        /* $('.formdivb').each(function(i,a){
            $('.ui-textbox, select',a).each(function(i,b){
                var _name=$(b).attr('name');
                var _value=$(b).val();
                formdateb[_name]=_value;
            });
        }); */
        perList.push(formdatea);
        /* perList.push(formdateb); */
        return JSON.stringify(perList);
    }

    //保存事件
    function saveFormDate(){
        var form = liger.get("formSet");
        if (!form.valid()) {
            top.$.ligerDialog.SQalert({content: LogUtils.LOG_CMM_MUST_FIX_ITEM_INFO,SQ_type: "warning"});
            return false; //验证不通过，不执行以下代码
        }

        if(parseFloat($('.formdiva input[name=j9294]').val()).toFixed(2)!=(parseFloat($('.formdiva input[name=j9282]').val())+parseFloat($('.formdiva input[name=j9293]').val())).toFixed(2)){
            top.$.ligerDialog.SQalert({content: "第一列填报数据必须符合规则：资产部类总计=资产合计+支出合计",SQ_type: "warning"});
            return false; //验证不通过，不执行以下代码
        }
        /* if(parseFloat($('.formdivb input[name=j9294]').val()).toFixed(2)!=(parseFloat($('.formdivb input[name=j9282]').val())+parseFloat($('.formdivb input[name=j9293]').val())).toFixed(2)){
            top.$.ligerDialog.SQalert({content: "第二列填报数据必须符合规则：资产部类总计=资产合计+支出合计",SQ_type: "warning"});
            return false; //验证不通过，不执行以下代码
        } */
        var total1 = (parseFloat($('.formdiva input[name=j9303]').val())+parseFloat($('.formdiva input[name=j9311]').val())+parseFloat($('.formdiva input[name=j9319]').val())).toFixed(2);
        if(parseFloat($('.formdiva input[name=j9320]').val()).toFixed(2)!=total1){
            top.$.ligerDialog.SQalert({content: "第一列填报数据必须符合规则：负债部类总计=负债合计+净资产合计+收入合计",SQ_type: "warning"});
            return false; //验证不通过，不执行以下代码
        }
        /* var total2 = (parseFloat($('.formdivb input[name=j9303]').val())+parseFloat($('.formdivb input[name=j9311]').val())+parseFloat($('.formdivb input[name=j9319]').val())).toFixed(2);
        if(parseFloat($('.formdivb input[name=j9320]').val()).toFixed(2)!=total2){
            top.$.ligerDialog.SQalert({content: "第二列填报数据必须符合规则：负债部类总计=负债合计+净资产合计+收入合计",SQ_type: "warning"});
            return false; //验证不通过，不执行以下代码
        } */
        var url = '<%=path%>/customer/filFinanceDebtZx/addDebtZx.do';
        var wait_dialog;
        var data = {};
        data["cstId"] = $("#cstId").val();
        data["formData"] = getFormValue();
        $.ajax({
            type: 'post',
            dataType:'json',
            data:data,
            url: url,
            beforeSend: function(){
                wait_dialog=$.ligerDialog.SQalert({content: LogUtils.LOG_CMM_DATA_LOADING ,SQ_type: "waitting" });
                isSwitch(0);
            },
            success:function(msg){
                wait_dialog.close();
                if(msg.success == 1){
                    top.$.ligerDialog.SQalert({content: msg.info,SQ_type: "success"});
                }else{
                    top.$.ligerDialog.SQalert({content: msg.info,SQ_type: "error"});
                }
            }
        });
    }
    //批量导入
    function addBatch(){
        //获取上传文件地址
        var files=getUploadResultParams();
        if(files&&files.length>0){
            var filePath=files[0].filePath;
            var fileExtension = filePath.substring(filePath.lastIndexOf('.') + 1);
            if(fileExtension!='xls'&&fileExtension!='XLS'){
                $.ligerDialog.SQalert({content: "请上传.xls后缀的文件", SQ_type: "warn"});
                return;
            }
            var wait_dialog;
            $.ajax({
                type: 'post',
                dataType:'json',
                data:"filePath="+filePath,
                url: '<%=path%>/customer/filFinanceDebtZx/financeDebtZxXls.do',
                beforeSend: function(){
                    wait_dialog=$.ligerDialog.SQalert({content: LogUtils.LOG_CMM_DATA_LOADING ,SQ_type: "waitting" });
                },
                success:function(msg){
                    wait_dialog.close();
                    if(msg.success == 1){
                        setFormData(msg.data);
                        isSwitch(1);
                    }else{
                        $.ligerDialog.SQalert({content:msg.info, SQ_type: "error"});
                    }
                }
            });
        }else{
            $.ligerDialog.SQalert({content: "请先上传文件", SQ_type: "warn"});
        }
    }
</script>
</body>
</html>